 <template>
  <el-container style="height: 900px; border: 5px solid #eee;"> 
    <el-aside width="200px" >
    <el-menu :unique-opened="true" :router="true">

        <el-submenu index="1">
          <template slot="title"><i class="el-icon-dish-1" style="color: orange"></i>会员信息</template>
          <el-menu-item index="/order/DianCan"><i class="el-icon-dish-1"></i>点 餐</el-menu-item>
          <el-menu-item index="/order/CaiDanGuanLi" v-show="this.userInfo.identify === 'ad'" ><i class="el-icon-menu"></i>菜 单 管 理</el-menu-item>
        </el-submenu>
      
    
       <el-submenu index="2">
        <template slot="title"><i class="el-icon-menu"></i>正在进行的订单</template>
          <el-menu-item index="/myOrder" v-show="this.userInfo.identify === 'cl'"><i class="el-icon-s-claim" ></i>我 的 订 单</el-menu-item>
          <el-menu-item index="/orderManage" v-show="this.userInfo.identify === 'ad'"><i class="el-icon-edit-outline"></i>订 单 管 理</el-menu-item>
  
       </el-submenu>
        <el-menu-item  @click="goToHome">
        <i class="el-icon-back"></i>返 回
      </el-menu-item>

       </el-menu>
      </el-aside>

       <main class="main" style="flex: 1; display: flex; overflow: auto;" >
      <router-view>
      </router-view>
    </main>

  </el-container>
</template>





<script>

export default {
  data() {
    return {
      userInfo: {},
      currentPage: 1,
      pagesize: 10,
      total: 0,
      orderList: [],
    };
  },

  mounted() {

    this.userInfo = JSON.parse(localStorage.getItem("user"));
  
    console.log(this.userInfo);
    
  },

  methods: {
   showOrderTable() {
      this.$http.get('/order/getAll') // 确保URL与你的后端API匹配
        .then(response => {
          if (response.status === 200 ) {
            this.orderList = response.data; // 确保响应数据是数组格式
          } else {
            console.error("API返回的数据不是有效数组:", response.data);
          }
        })
        .catch((error) => {
          console.error("请求订单数据失败:", error);
          
        });
      
    },
    goToHome() {
      
      this.$router.push("/");
    },
   
  },

  
}
  

</script>

  <style scoped>
  .el-header {
    background-color: #B3C0D1;
    color: #333;
    line-height: 400px;
  }


 
  
  .el-aside {
    color: #333;
  }
.el-menu-item {
  
  width: 230px; /* 设置菜单项的宽度 */
}

.el-container {
    width: 102%; /* 确保el-container占满整个页面宽度 */
    height: 900px;
    border: 10px solid #eee;
  }

.menu-text {
  font-size: 18px;
  padding-top: 10px;
}
</style>